/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
/**
 *
 * @author 1906528
 */
public class Player extends People {
    private static Gun gun;
    private Hotbar gunbar;
    private double money;
    private final int MAX_BULLETS = 20;
    public Player(Spatial mod, Node attaching){
        super(mod, attaching);
        gunbar = new Hotbar();
        gunbar.setSelected("Pistol");
        gun = gunbar.getGunSelected();
        money = 0;
    }
    public Hotbar getHotBar(){return gunbar;}
    public Gun gunEquipped(){return gun;}
    public void setEquipped(Gun select){gun = select;}
    public double getMoney(){return money;}
    public void setMoney(double num){money = num;}
    public void addMoney(double num){money += num;}
    public void reset(){
        money *= .9;
    }
    public Gun getGun(){
        return gun;
    }
    @Override
    public void checkDeath(){
        if(character.getPhysicsLocation().y <= -10 || health <= 0){
            character.setPhysicsLocation(new Vector3f(0f,30f,10f));
            health = 100;
            gun.reset();
            gunbar.reset();
            reset();
        }
    }
    public String getStringGun(){
        return gun.getGunName();
    }
    public void setGun(String gunselect){
        gunbar.setSelected(gunselect);
        gun = gunbar.get(gunbar.getSelected());
    }
    public void setGun(int index){
        gunbar.setSelected(index);
        gun = gunbar.get(gunbar.getSelected());
    }
}